package com.itheima.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.entity.UserLikeMessage;
import com.itheima.enums.MqOperationEnum;
import com.itheima.mapper.UserLikeMessageMapper;
import com.itheima.service.UserLikeMessageService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author 51585
 * @description 针对表【user_like_message】的数据库操作Service实现
 * @createDate 2022-12-13 08:57:29
 */
@Service
public class UserLikeMessageServiceImpl extends ServiceImpl<UserLikeMessageMapper, UserLikeMessage>
        implements UserLikeMessageService {

    @Resource
    private UserLikeMessageMapper userLikeMessageMapper;

    @Override
    public void mqOperation(Integer messageId, String userId, String operation) {
        int status= 0;
        if (operation.equals(MqOperationEnum.likeOperation.name())) {
            status=1;
        }
        userLikeMessageMapper.mqOperation(messageId,userId,status);
    }

}




